n = 3
for i in range(1, n+1):
    for j in range(n-1, 0, 1):
        print(" ", end="")
    for k in range(1, 2*n, 2):
        print("*", end="")
    print()

# 打印菱形
for i in range(1, 8, 2):
    print(("*"*i).center(7))
for i in range(5, 0, -2):
    print(("*"*i).center(7))

hang = 15
for i in range(1, 2*((hang-1)//2+1), 2):
    print(("*"*i).center(hang))
for i in range(2*((hang-1)//2)-1, 0, -2):
    print(("*"*i).center(hang))

# 打印水仙花数
for i in range(100, 1000):
    a = i % 10
    b = i // 10 % 10
    c = i // 100
    if a ** 3 + b ** 3 + c ** 3 == i:
        print(i)

# 打印九九乘法表
for i in range(1, 10):
    for j in range(1, i+1):
        print("%d*%d=%d" % (j, i, i*j), end=" ")
    print()

# 打印完数
for i in range(1, 100):
    sum = 0
    for j in range(1, i):
        if i % j == 0:
            sum += j
    if sum == i:
        print(i)

# 打印质数
for i in range(2, 100):
    for j in range(2, i):
        if i % j == 0:
            break
    else:
        print(i)

# 打印裴波那契数列
def fib(n):
    if n < 2:
        return n
    else:
        return fib(n-1) + fib(n-2)